import React, { Component } from 'react'
import './index.css'
export default class List extends Component {
    render() {
        const {users,isFrist,isLoading,err}=this.props
        return (
           
                 <div className="row">
                        {
                        //判断 状态。利用三元符号去处理
                        isFrist? <h2>欢迎使用，随后点击搜索</h2>:isLoading?<h2 style={{color:'red'}}>Loading.....</h2 >:err?<h2>{err}</h2>:
                        users.map((item,index)=>{
                            return <div className="card" key={item.id}>
                            <a href={item.html_url} target="_blank" rel="noreferrer">
                                <img
                                alt="head_port"
                                src={item.avatar_url}
                                style={{ width: "100px" }}
                                />
                            </a>
                            <p className="card-text">{item.login}</p>
                            </div>
                        })}      
                 </div>
        
            
        )
    }
}
